
package com.rt.schedulenew.utils.global;
public enum ErrorCode
{
    SUCCESS("0", "操作成功"), 
    FAIL("1", "操作失败"), 
    TOKEN_NO_PASS("102", "Token验证失败"), 
    SECURITY_NO_PASS("103", "应用授权验证失败"), 
    INTERNAL_SERVER_ERROR("500", "http请求错误"), 
    UNKNOWN_ERROR("999", "未知错误");
    
    private String key;
    private String value;
    
    ErrorCode(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static ErrorCode get(String key) {
        ErrorCode[] values = values();
        for (ErrorCode obj : values) {
            if (obj.key.equals(key)) {
                return obj;
            }
        }
        return null;
    }
}
